function maxPrice(arr) {
    let index = 0;
    let max = 0;
    for (let i = 0; i < arr.length; i++) {
        if(arr[i] < min){
            index = i
        }
        max = Math.max(max, arr[i] - arr[index])
    }
    return max
}